﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for EmployeeBLL
/// </summary>

public class CardPriceBLL : ICardPriceBLL
{
    //inject DAL
    private ICardPriceDAL cardPriceDAL = Factory<ICardPriceDAL>.CreateInstance();

    public CardPriceBLL()
    {
        //
        // TODO: Add constructor logic here
        //
    }

    /// <summary>
    /// GetAll
    /// </summary>
    /// <returns>List<CardPrice></returns>
    public List<CardPrice> GetAll()
    {
        try
        {
            return cardPriceDAL.GetAll();
        }
        catch (Exception)
        {
            throw;
        }
    }


    /// <summary>
    /// 
    /// </summary>
    /// <param name="id">Guid</param>
    /// <returns>CardPrice</returns>
    public CardPrice GetById(Guid id)
    {
        try
        {
            return cardPriceDAL.GetById(id);
        }
        catch (Exception)
        {
            throw;
        }
    }


    /// <summary>
    /// InsertOrUpdate
    /// </summary>
    /// <param name="cardPrice">CardPrice</param>
    /// <returns>CardPrice</returns>
    public bool InsertOrUpdate(CardPrice cardPrice)
    {
        try
        {
            return cardPriceDAL.InsertOrUpdate(cardPrice);
        }
        catch (Exception)
        {
            throw;
        }
    }

    /// <summary>
    /// Delete
    /// </summary>
    /// <param name="id">Guid</param>
    /// <returns>bool</returns>
    public bool Delete(Guid id)
    {
        try
        {
            return cardPriceDAL.Delete(id);
        }
        catch (Exception)
        {
            throw;
        }
    }

    public bool IsExistCardPrice(CardPrice cardPrice) 
    {
        try
        {
            return cardPriceDAL.IsExistCardPrice(cardPrice);
        }
        catch (Exception)
        {
            throw;
        }
    }
}

